Skip to content

FreeRTOS restore original behaviour and allow override startup hooks #445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 24, 2025

Conversation

pennam
Copy link
Contributor

@pennam pennam commented Feb 19, 2025

The default behaviour is do nothing: scheduler has to be started manually by the user.
Use AUTOSTART_FREERTOS if you declare tasks in your setup() and use them in loop().
Use EARLY_AUTOSTART_FREERTOS if you need the scheduler to be already running in setup().

Libraries that need to use threads/semaphores during setup() for example, to implement the usual

myObj.begin(); <- this starts a thread
while (!myObj) {  <- this becomes true when the thread is unlocked
  delay();
}

will need to declare EARLY_START_FREERTOS_HOOK in one of their cpp files

Also fixes #414 (comment)

/cc @hexnet1234 @gpb01 @Wetmelon

pennam and others added 6 commits February 19, 2025 14:18
The default behaviour is do nothing: scheduler has to be started manually by the user.
Use AUTOSTART_FREERTOS if you declare tasks in your setup() and use them in loop().
Use EARLY_AUTOSTART_FREERTOS if you need the scheduler to be already running in setup().

Libraries that need to use threads/semaphores during setup() (for example, to implement the usual

myObj.begin(); <- this starts a thread
while (!myObj) {  <- this becomes true when the thread is unlocked
  delay();
}

will need to declare EARLY_START_FREERTOS_HOOK in one of their cpp files
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Feb 20, 2025
@pennam pennam merged commit c081119 into arduino:main Feb 24, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants